package cate.game.power;

import cate.common.table.d.GDFunc;
import cate.common.table.item.hero.row.HeroBaseRow;
import cate.game.attr.PowerAttrPart;
import cate.game.play.part.PlaySide;
import cate.game.role.Role;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;


@NoteClass("阵法对属性的影响")
public class PositionPowerFactor {

	@NoteField("阵法升级")
	private PositionDevPowerFactor positionDev;

	@NoteField("灵王祭祀")
	private KingSacrificePowerFactor kingSacrifice;

	public PositionPowerFactor(Role role, PlaySide playSide,int funcId) {
		positionDev = new PositionDevPowerFactor(role,playSide);
		if (funcId == GDFunc.GRADE_PVP) {
			kingSacrifice = new KingSacrificePowerFactor(role);
		}
	}


	public PowerAttrPart buildHeroPart(HeroBaseRow row, byte pos) {
		PowerAttrPart attrPart = new PowerAttrPart();
		if (positionDev != null) {
			attrPart.merge(positionDev.buildHeroPart(pos));
		}
		if (kingSacrifice != null) {
			attrPart.merge(kingSacrifice.buildHeroPart(row.job));
		}
		return attrPart;
	}
}
